How to write external gadgets for use with StormWIZARD ® HAAGE & PARTNeR Computer GmbH written by Jan-Claas Dirks External gadgets are used to implement new elements for your GUI with new appearance and behaviour on user input. For StormWIZARD, external gadgets are BOOPSI classes. They are implemented as AMIGA shared libraries. A library with an external gadget contains two public functions to add and to remove the gadget class. Basically, MakeClass() and FreeClass() are called. Furthermore, the library contains a dispatcher that is specified in the MakeClass() call. By using this dispatcher, new gadgets are created, attributes are set and asked for, gadgets get layouted, rendered etc.. External gadgets for StormWIZARD react on standard BOOPSI dispatcher calls like OM_NEW, GM_RENDER as well on StormWIZARD-specific calls. An example are calls for the layouting process. Further useful information on StormWIZARD external gadgets can be found in and the Rom Kernal Manual "Libraries", BOOPSI chapter. Commonly, you will have three source files for your library. First, a .fd-file which tells the which functions to be put into the library and what the base name of the library should be. You won't have to spend too much time editing this file. The base name is of no relevance as opening, closing and calling the two public functions of this library is done by StormWIZARD. And, as the two public functions have fixed positions in the library, you don't have to edit those lines at all. Secondly, you will have to create a header file that defines the tags that can be used to control your gadget via SetGadgetAttrs(), GetAttrs() etc.. Public enumerations etc. should be placed here, too. This header file is then included in those source files in which the gadget is being used. Finally, the implementation of the two public functions and the dispatcher can be found in the main source file. Using StormC makes the development of the library easy. Create a new project and save it to a location of your choice. Add a .fd-, a .h- and a .c-file and confirm to create them. Select the executable as LIBS:wizard_yourlibraryname.library. Now tune the compiler and linker settings to your needs. In particular, select 'Link as shared library' at 'Program generation' on the 'Linker 1' page of the linker settings. Compiling the project places the library just where it needs to be to be found by the operating system. You are now ready to test your gadget in the StormWIZARD editor. Create a window with all the groups and gadgets you need. To use your own gadget, select the 'libraries' page and 'add' a new one. In the attribute window, give the new library object a name and specify the library name on disk (wizard_yourlibraryname.library) without the leading 'LIBS:'. Now move to the 'gadgets' page and add an 'external' gadget. In the attribute window, select the extern page and specify the external library object you just have created. In the Data 0 .. Data 7 numberfields, you can preset attribute tags for your gadget. Finally, use your gadget in your application. In your application, you do not need to take more care about external gadgets that about StormWIZARD's gadgets. The GUI is loaded, opened and handled with the same functions of the wizard.library or that you've written by yourself. Include the external library's header file you've written to make use of the tags you've defined to control the gadget. Words are for the mind, source is for the code. Please complain to HAAGE & Partner Computer GmbH if that phrase sounds strange to native English speakers. However, there is a project for use with StormC to show you how to implement an external gadget. While the header and .fd-file are of a managable size, the .c-file is a good place to get lost. Useful comments and source code you will have to adapt to your needs are marked by the character sequence '//!'. As using external gadgets in your application differs in no way from using StormWIZARD's gadgets, there is no application source example provided.